*set Working directory where file is located

set more off

******************************
*Main Article 
******************************
*
***********
* Table 1 
***********
use "Replicationdata_DoProfessionalsTakeOver_Voluntas2"
*compared to the dataset used in Table 2, the variable decide introduces a higher number of missing values
*this results in a lower number of observations included 
 
tab decide meminfluence, col row

***********
* Table 2 
***********
use "Replicationdata_DoProfessionalsTakeOver_Voluntas1"

*defining variable labels
encode q73r, gen(country)

label define type 1 "Business" 2 "Professional" 3 "Labour" 4 "Identity" 5 "Cause" 6 "Leisure" 7 "Institutions"
label values type type  

label define funcdiff 0 "No working groups" 1 "Task-specific working groups"
label values q10_05r funcdiff  

label define funds 0 "No funding" 1 "0.01% to 50% of the budget" 2 "51% to 100% of the budget", replace
label values funds_cat funds

* ordered logistic regression models
 
ologit meminfluence b6.country b1.type age_cent staff_cent b0.q10_05r mem_cent b0.funds_cat insider_cent
eststo model1

ologit meminfluence b6.country b1.type age_cent b0.q10_05r c.staff_cent##c.mem_cent b0.funds_cat insider_cent
eststo model2

ologit meminfluence b6.country b1.type age_cent b0.q10_05r c.staff_cent##c.mem_cent b0.q10_05r##c.mem_cent b0.funds_cat insider_cent
eststo model3

esttab model1 model2 model3 using "Table2.rtf", replace wide nogap onecell cells(b(star fmt(%9.2f)) se(par))                ///
        stats(N aic , fmt(%9.0g %9.0f %9.0f) labels("N" "AIC"))      ///
		starlevels(* 0.10 ** 0.05 *** 0.01)	///
        legend label collabels(none) ///
		varlabels(_cons "Constant" country "Country" type "Group type"  ///
		age_cent "Age (log)"  staff_cent "Number of staff (log)" ////
		q10_05r "Functional differentiation" mem_cent "Membership involvement (index)" funds_cat "Government funding" insider_cent "Political insider (index)") ///
		nobaselevels interaction("*") ///
		mtitles("Model 1" "Model 2" "Model 3")  mtitle nonumbers 

***********
* Figure 1 
***********
**post estimation
*predicted probabilities
* staff & membership invo 
margins, at(c.mem_cent==(-1 (0.1) 1) c.staff_cent==(-1 1)) predict(outcome(3)) 
marginsplot, title("") recast(line) recastci(rarea) ytitle("Predicted probability of 'very influential' members") xtitle("Membership involvement") scheme(s1mono) 
*layout and labels are adjusted manually


******************************
*Appendix
******************************

***********
* Figure A1 
***********
*marginal effects
margins, dydx(staff_cent) at(mem_cent==(-1 (0.2) 1)) predict(outcome(1)) 
marginsplot,title("") level(95) yline(0) recast(line) recastci(rarea) ci1opts(fintensity(30)) ytitle("Effects on Pr(Lowly Influential)") xtitle("Membership involvement") scheme(s1mono)  name(plot1, replace)

margins, dydx(staff_cent) at(mem_cent==(-1(0.2) 1)) predict(outcome(2)) 
marginsplot,title("") level(95) yline(0) recast(line) recastci(rarea) ci1opts(fintensity(30)) ytitle("Effects on Pr(Moderately Influential)") xtitle("Membership involvement") scheme(s1mono) name(plot2, replace)

margins, dydx(staff_cent) at(mem_cent==(-1(0.2) 1)) predict(outcome(3)) 
marginsplot,title("") level(95) yline(0) recast(line) recastci(rarea) ci1opts(fintensity(30)) ytitle("Effects on Pr(Highly Influential)")  xtitle("Membership involvement") scheme(s1mono) name(plot3, replace)

graph combine plot1 plot2 plot3, ycommon
*layout and labels are adjusted manually


***********
* Table A2 
***********
use "Replicationdata_DoProfessionalsTakeOver_Voluntas2"
*compared to the first dataset the alternative variables introduce a higher number of missing values
*this results in a lower number of observations included in the regression models
 
* defining variable labels
encode q73r, gen(country)

label define type 1 "Business" 2 "Professional" 3 "Labour" 4 "Identity" 5 "Cause" 6 "Leisure" 7 "Institutions"
label values type type  

label define funcdiff 0 "No working groups" 1 "Task-specific working groups"
label values q10_05r funcdiff  

label define funds 0 "No funding" 1 "0.01% to 50% of the budget" 2 "51% to 100% of the budget"
label values funds_cat funds

label define decide 1 "Decision made by members" 2 "Decision made by board" 3 "Decision made by staff"
label values decide decide

label define Nmembers 1 "None" 2 "N individual members (below average)" 3 "N individual members (above average)" 
label values q04_05r Nmembers

label define Norg 1 "None" 2 "N business members (below average)" 3 "N business members (above average)" 
label values q04_27r Norg
 
* ordered logistic regression models 
ologit meminfluence b6.country b1.q04_05r b1.q04_27r age_cent staff_cent b0.q10_05r b1.decide  b0.funds_cat insider_cent
eststo model1

ologit meminfluence b6.country b1.q04_05r b1.q04_27r age_cent staff_cent  b0.q10_05r c.staff_cent##b1.decide  b0.funds_cat insider_cent
eststo model2

ologit meminfluence b6.country b1.q04_05r b1.q04_27r age_cent  b0.q10_05r c.staff_cent##b1.decide  b0.q10_05r##b1.decide  b0.funds_cat insider_cent
eststo model3

esttab model1 model2 model3 using "TableA2.rtf", replace wide nogap onecell cells(b(star fmt(%9.2f)) se(par))                ///
        stats(N aic , fmt(%9.0g %9.0f %9.0f) labels("N" "AIC"))      ///
		starlevels(* 0.10 ** 0.05 *** 0.01)	///
        legend label collabels(none) ///
		varlabels(_cons "Constant" country "Country"   ///
		q04_05r "Number of individual members "  q04_27r "Number of business members" decide "Decision-making" ///
		age_cent "Age (log)"  staff_cent "Number of staff (log)" ////
		q10_05r "Functional differentiation" mem_cent "Membership involvement (index)" funds_cat "Government funding" insider_cent "Political insider (index)") ///
		nobaselevels interaction("*") ///
		mtitles("Model 1" "Model 2" "Model 3")  mtitle nonumbers 

***********
* Table A3 
***********
use "Replicationdata_DoProfessionalsTakeOver_Voluntas3"
*compared to the first dataset the alternative variables introduce a higher number of missing values
*this results in a lower number of observations included in the regression models


 * defining variable labels
encode q73r, gen(country)

label define type 1 "Business" 2 "Professional" 3 "Labour" 4 "Identity" 5 "Cause" 6 "Leisure" 7 "Institutions"
label values type type  

label define funcdiff 0 "No working groups" 1 "Task-specific working groups"
label values q10_05r funcdiff  

label define funds 0 "No funding" 1 "0.01% to 50% of the budget" 2 "51% to 100% of the budget"
label values funds_cat funds

* ordered logistic regression models
 
ologit meminfluence b6.country b1.type age_cent staff_cent b0.q10_05r mem_cent lid_cent insider_cent
eststo model1

ologit meminfluence b6.country b1.type age_cent b0.q10_05r c.staff_cent##c.mem_cent lid_cent insider_cent
eststo model2

ologit meminfluence b6.country b1.type age_cent b0.q10_05r c.staff_cent##c.mem_cent b0.q10_05r##c.mem_cent lid_cent insider_cent
eststo model3

esttab model1 model2 model3 using "Table3A.rtf", replace wide nogap onecell cells(b(star fmt(%9.2f)) se(par))                ///
        stats(N aic , fmt(%9.0g %9.0f %9.0f) labels("N" "AIC"))      ///
		starlevels(* 0.10 ** 0.05 *** 0.01)	///
		legend label collabels(none) ///
		varlabels(_cons "Constant" country "Country" type "Group type"  ///
		age_cent "Age (log)"  staff_cent "Number of staff (log)" ////
		q10_05r "Functional differentiation" mem_cent "Membership involvement (index)" lid_cent "Membership fees" insider_cent "Political insider (index)") ///
		nobaselevels interaction("*") ///
		mtitles("Model 1" "Model 2" "Model 3")  mtitle nonumbers 
